package com.zqu.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zqu.pojo.DevelopmentPlanDetail;
import com.zqu.service.DevelopmentPlanDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("developmentplandetail")
public class DevelopmentPlanDetailController {
    @Autowired
    private DevelopmentPlanDetailService developmentPlanDetailService;

    @RequestMapping("selectdevelopmentPlanDetaillist")
    @ResponseBody
    public PageInfo<DevelopmentPlanDetail> selectList(Integer pageNo, Integer pageSize){
        if(pageNo==null){
            pageNo=1;
        }
        if (pageSize==null){
            pageSize=5;
        }
        PageHelper.startPage(pageNo,pageSize);
        List<DevelopmentPlanDetail> list = developmentPlanDetailService.selectList(new DevelopmentPlanDetail());
        PageInfo<DevelopmentPlanDetail> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
